/* 分类页面样式 - 与主系统配色方案保持一致 */

/* 轻量级筛选链接样式 */
.filter-link {
    display: inline-block;
    padding: 6px 12px;
    color: var(--color-gray-600);
    font-size: 14px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    line-height: 1.2;
}

.filter-link:hover {
    color: var(--color-blue-600);
}

.filter-link.active {
    color: var(--color-blue-600);
    font-weight: 500;
}

.filter-link:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 10px;
    background-color: var(--color-gray-300);
}

/* 移除最后一个元素的分隔符 */
.filter-link:last-child::after {
    display: none;
}

/* 筛选区域整体样式 */
.filter-section {
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    border-radius: 8px;
    padding: 16px;
}

/* 筛选行样式 */
.filter-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

/* 筛选标签容器 */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 4px;
}

/* 筛选标签样式 - 使用Tailwind CSS变量 */
.filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: var(--color-gray-100);
    border: 1px solid var(--color-gray-300);
    border-radius: 20px;
    color: var(--color-gray-500);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.filter-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.filter-tag:hover {
    background: var(--color-blue-100);
    border-color: var(--color-blue-400);
    color: var(--color-blue-500);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in oklab, var(--color-blue-500) 15%, transparent);
}

.filter-tag:hover::before {
    left: 100%;
}

.filter-tag.active {
    background: var(--color-blue-500);
    border-color: var(--color-blue-500);
    color: white;
    box-shadow: 0 4px 12px color-mix(in oklab, var(--color-blue-500) 30%, transparent);
    transform: translateY(-1px);
}

.filter-tag.active::after {
    content: '✓';
    margin-left: 6px;
    font-size: 12px;
    font-weight: bold;
}

.filter-tag.disabled {
    background: var(--color-gray-100);
    border-color: var(--color-gray-300);
    color: color-mix(in oklab, var(--color-gray-900) 25%, transparent);
    cursor: not-allowed;
    opacity: 0.6;
}

.filter-tag.disabled:hover {
    background: var(--color-gray-100);
    border-color: var(--color-gray-300);
    color: color-mix(in oklab, var(--color-gray-900) 25%, transparent);
    transform: none;
    box-shadow: none;
}

/* 筛选区域 - 现代化设计，使用Tailwind配色 */
.filter-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(8px);
}

.filter-row {
    margin-bottom: 20px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
}

.filter-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.filter-row::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #3b82f6, #60a5fa); /* blue-500 to blue-400 */
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-row:hover::before {
    opacity: 1;
}

.filter-label {
    font-size: 15px;
    font-weight: 600;
    color: #111827; /* gray-900 */
    margin-right: 20px;
    margin-bottom: 12px;
    white-space: nowrap;
    min-width: 100px;
    display: flex;
    align-items: center;
    position: relative;
}

.filter-label::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 16px;
    background: #dbeafe; /* blue-100 */
    border-radius: 1px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* 商品网格布局 */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

/* 商品图片固定尺寸 */
.goods-item-image {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

/* 商品项样式 */
.goods-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.goods-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 价格标签 */
.price-tag {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
}

.price-tag.free {
    background-color: #10b981;
}

.price-tag.paid {
    background-color: #ef4444;
}

/* 收藏按钮 */
.favorite-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.favorite-btn:hover {
    background-color: white;
    color: #ef4444;
}

/* 加载更多提示 */
.loading-more {
    text-align: center;
    padding: 20px;
    color: #666;
}

.no-more-data {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .goods-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 14px;
    }

    .goods-item-image {
        height: 115px;
    }
}

@media (max-width: 768px) {
    .goods-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 12px;
    }

    .goods-item-image {
        height: 100px;
    }

    .filter-section {
        padding: 16px;
        border-radius: 8px;
        margin-bottom: 16px;
    }

    .filter-row {
        margin-bottom: 16px;
        padding: 12px 0;
    }

    .filter-row::before {
        left: -16px;
        width: 3px;
    }

    .filter-label {
        min-width: 80px;
        font-size: 14px;
        margin-right: 16px;
        margin-bottom: 8px;
    }

    .filter-label::after {
        right: -8px;
        height: 12px;
    }

    .filter-tag {
        font-size: 13px;
        padding: 5px 12px;
        margin: 2px;
        border-radius: 16px;
    }

    .filter-options {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .goods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .goods-item-image {
        height: 85px;
    }

    .filter-section {
        padding: 12px;
        border-radius: 6px;
    }

    .filter-row {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 12px;
        padding: 8px 0;
    }

    .filter-row::before {
        display: none;
    }

    .filter-label {
        margin-bottom: 8px;
        margin-right: 0;
        min-width: auto;
        font-size: 13px;
        font-weight: 500;
    }

    .filter-label::after {
        display: none;
    }

    .filter-tag {
        font-size: 12px;
        padding: 4px 10px;
        margin: 1px;
        border-radius: 14px;
    }

    .filter-options {
        gap: 4px;
        width: 100%;
    }
}

@media (max-width: 360px) {
    .goods-grid {
        gap: 8px;
    }

    .goods-item-image {
        height: 75px;
    }

    .filter-tag {
        font-size: 11px;
        padding: 3px 8px;
        border-radius: 12px;
    }
}

/* 筛选区域增强效果 */
.filter-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 筛选标签加载动画 */
@keyframes filterTagFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.filter-tag {
    animation: filterTagFadeIn 0.3s ease-out;
}

.filter-tag:nth-child(1) { animation-delay: 0.05s; }
.filter-tag:nth-child(2) { animation-delay: 0.1s; }
.filter-tag:nth-child(3) { animation-delay: 0.15s; }
.filter-tag:nth-child(4) { animation-delay: 0.2s; }
.filter-tag:nth-child(5) { animation-delay: 0.25s; }
.filter-tag:nth-child(6) { animation-delay: 0.3s; }
.filter-tag:nth-child(7) { animation-delay: 0.35s; }
.filter-tag:nth-child(8) { animation-delay: 0.4s; }

/* 筛选行标题图标 */
.filter-label[data-icon]::before {
    content: attr(data-icon);
    margin-right: 8px;
    font-size: 16px;
    color: #3b82f6; /* blue-500 */
}

/* 清除筛选按钮样式 */
.clear-filters-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #fef2f2; /* red-50 */
    border: 1px solid #ef4444; /* red-500 */
    border-radius: 20px;
    color: #ef4444; /* red-500 */
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.clear-filters-btn:hover {
    background: #ef4444; /* red-500 */
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 34, 45, 0.3);
}

.clear-filters-btn i {
    margin-right: 6px;
    font-size: 12px;
}

/* 筛选结果统计 */
.filter-result-count {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f0fdf4; /* green-50 */
    border: 1px solid #10b981; /* emerald-500 */
    border-radius: 16px;
    color: #10b981; /* emerald-500 */
    font-size: 12px;
    font-weight: 600;
    margin-left: 12px;
}

.filter-result-count::before {
    content: '📊';
    margin-right: 4px;
}

/* 深色模式适配 - 使用Tailwind配色 */
@media (prefers-color-scheme: dark) {
    .filter-section {
        background: #1f2937; /* gray-800 */
        border-color: #374151; /* gray-700 */
    }

    .filter-tag {
        background: #374151; /* gray-700 */
        border-color: #4b5563; /* gray-600 */
        color: rgba(255, 255, 255, 0.65);
    }

    .filter-tag:hover {
        background: #1e3a8a; /* blue-800 */
        border-color: #60a5fa; /* blue-400 */
    }
}
